
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <asm/uaccess.h>
#include <asm/irq.h>
#include <asm/io.h>
#include <linux/cdev.h>
#include <linux/device.h>
#include <linux/moduleparam.h>
#include <linux/spinlock.h>
#include <linux/uaccess.h>
#include <linux/kmod.h>

static int __init call_usermode_init(void)
{
	int ret = -1;

	char path[] = "/bin/mkdir";

	char *argv[] = {path, "-p","/home/pi/Workspace/led/new_dir", NULL};
	char *envp[] = {NULL};

	printk("call_usermodehelper module isstarting..!\n");

	ret = call_usermodehelper(path, argv, envp,UMH_WAIT_PROC);

	printk("ret=%d\n", ret);

	return 0;
}

static void __exit call_usermode_exit(void)
{
int ret = -1;

	char path[] = "/bin/rm";

	char *argv[] = {path, "-r","/home/pi/Workspace/led/new_dir", NULL};

	char *envp[] = {NULL};



	printk("call_usermodehelper module isstarting..!\n");

	ret = call_usermodehelper(path, argv, envp,UMH_WAIT_PROC);

	printk("ret=%d\n", ret);
	}
module_init(call_usermode_init);
module_exit(call_usermode_exit);

/* 描述驱动程序的一些信息，不是必须的 */
MODULE_AUTHOR("ChenBlue");
MODULE_VERSION("0.1.0");
MODULE_DESCRIPTION("raspberry LED Driver");
MODULE_LICENSE("GPL");


